$(document).ready(function() {
	//检测
	$("#userName").attr("nullmsg",pleaseinutusername);	//请输入用户名
	$("#userName").attr("title",username);
	$("#email").attr("nullmsg",pleaseinutemail);
	$("#email").attr("title",email);
	$("#password").attr("nullmsg",pleaseinutpassword);
	$("#password").attr("title",password);
	$("#phone").attr("nullmsg",pleaseinutphone);
	$("#phone").attr("title",phone);
	$("#randCodeImageStr").attr("nullmsg",pleaseinputvalidatecode);
	$("#randCodeImageStr").attr("title",validatecode);
	
}

);


$('#randCodeImage').click(function(){
    reloadRandCodeImage();
});
/**
 * 刷新验证码
 */
function reloadRandCodeImage() {
    var date = new Date();
    var img = document.getElementById("randCodeImage");
    img.src='randCodeImage?a=' + date.getTime();
}



//登录处理函数


//点击消息关闭提示
$('#alertMessage').click(function() {
	hideTop();
});
//显示错误提示
function showError(str) {
	$('#alertMessage').addClass('error').html(str).stop(true, true).show().animate({
		opacity : 1,
		right : '0'
	}, 5000);

}

function showSuccess(str) {
	$('#alertMessage').removeClass('error').html(str).stop(true, true).show().animate({
		opacity : 1,
		right : '0'
	}, 5000);
}


function hideTop() {
	$('#alertMessage').animate({
		opacity : 0,
		right : '-20'
	}, 5000, function() {
		$(this).hide();
	});
}
